{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"http://hilpisch.com/tpq_logo.png\" alt=\"The Python Quants\" width=\"35%\" align=\"right\" border=\"0\"><br>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Python for Finance (2nd ed.)\n",
    "\n",
    "**Mastering Data-Driven Finance**\n",
    "\n",
    "&copy; Dr. Yves J. Hilpisch | The Python Quants GmbH\n",
    "\n",
    "<img src=\"http://hilpisch.com/images/py4fi_2nd_shadow.png\" width=\"300px\" align=\"left\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Appendix: Dates and Times"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pylab import mpl, plt\n",
    "plt.style.use('seaborn')\n",
    "mpl.rcParams['font.family'] = 'serif'\n",
    "%config InlineBackend.figure_format = 'svg'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Python"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime as dt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 14, 25, 59, 941482)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt.datetime.now()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 14, 25, 59, 945641)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "to = dt.datetime.today()  \n",
    "to"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(to)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "6"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt.datetime.today().weekday()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2020, 10, 31, 10, 5, 30, 500000)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = dt.datetime(2020, 10, 31, 10, 5, 30, 500000)  \n",
    "d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2020-10-31 10:05:30.500000'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "str(d)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2020-10-31 10:05:30.500000\n"
     ]
    }
   ],
   "source": [
    "print(d)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2020"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.year  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.month  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "31"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.day  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.hour  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "737729"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "o = d.toordinal()  \n",
    "o"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2020, 10, 31, 0, 0)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt.datetime.fromordinal(o)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.time(10, 5, 30, 500000)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t = dt.datetime.time(d)  \n",
    "t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.time"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(t)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2020, 10, 31)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dd = dt.datetime.date(d)  \n",
    "dd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2020, 10, 31, 10, 5)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.replace(second=0, microsecond=0)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.timedelta(days=-282, seconds=70770, microseconds=481838)"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "td = d - dt.datetime.now()  \n",
    "td"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.timedelta"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(td)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-282"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "td.days"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "70770"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "td.seconds"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "481838"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "td.microseconds"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-24294029.518162"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "td.total_seconds()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2020-10-31T10:05:30.500000'"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.isoformat()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Saturday, 31. October 2020 10:05AM'"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.strftime('%A, %d. %B %Y %I:%M%p')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2017, 3, 31, 0, 0)"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt.datetime.strptime('2017-03-31', '%Y-%m-%d')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2016, 4, 30, 0, 0)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt.datetime.strptime('30-4-16', '%d-%m-%y')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2020-10-31 10:05:30.500000'"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ds = str(d)\n",
    "ds"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2020, 10, 31, 10, 5, 30, 500000)"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt.datetime.strptime(ds, '%Y-%m-%d %H:%M:%S.%f')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 14, 26, 0, 81902)"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt.datetime.now()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 12, 26, 0, 85457)"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt.datetime.utcnow()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.timedelta(seconds=7199, microseconds=999998)"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dt.datetime.now() - dt.datetime.utcnow()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "class UTC(dt.tzinfo):\n",
    "    def utcoffset(self, d):\n",
    "        return dt.timedelta(hours=0)  \n",
    "    def dst(self, d):\n",
    "        return dt.timedelta(hours=0)  \n",
    "    def tzname(self, d):\n",
    "        return 'UTC'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "u = dt.datetime.utcnow()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 12, 26, 0, 101647)"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "u = u.replace(tzinfo=UTC())  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 12, 26, 0, 101647, tzinfo=<__main__.UTC object at 0x10ff20370>)"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "class CEST(dt.tzinfo):\n",
    "    def utcoffset(self, d):\n",
    "        return dt.timedelta(hours=2)  \n",
    "    def dst(self, d):\n",
    "        return dt.timedelta(hours=1)  \n",
    "    def tzname(self, d):\n",
    "        return 'CEST'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 14, 26, 0, 101647, tzinfo=<__main__.CEST object at 0x10ff588e0>)"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c = u.astimezone(CEST())  \n",
    "c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 13, 26, 0, 101647, tzinfo=<__main__.CEST object at 0x10ff588e0>)"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "c - c.dst()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pytz"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'United States'"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pytz.country_names['US']  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Europe/Brussels']"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pytz.country_timezones['BE']  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Pacific/Wake',\n",
       " 'Pacific/Wallis',\n",
       " 'US/Alaska',\n",
       " 'US/Arizona',\n",
       " 'US/Central',\n",
       " 'US/Eastern',\n",
       " 'US/Hawaii',\n",
       " 'US/Mountain',\n",
       " 'US/Pacific',\n",
       " 'UTC']"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pytz.common_timezones[-10:]  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "u = dt.datetime.utcnow()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "u = u.replace(tzinfo=pytz.utc)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 12, 26, 0, 300531, tzinfo=<UTC>)"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 14, 26, 0, 300531, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>)"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u.astimezone(pytz.timezone('CET'))  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 12, 26, 0, 300531, tzinfo=<StaticTzInfo 'GMT'>)"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u.astimezone(pytz.timezone('GMT'))  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2021, 8, 8, 7, 26, 0, 300531, tzinfo=<DstTzInfo 'US/Central' CDT-1 day, 19:00:00 DST>)"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "u.astimezone(pytz.timezone('US/Central'))  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## NumPy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numpy.datetime64('2020-10-31')"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nd = np.datetime64('2020-10-31') \n",
    "nd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2020-10-31'"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.datetime_as_string(nd)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('D', 1)"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.datetime_data(nd)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2020, 10, 31, 10, 5, 30, 500000)"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numpy.datetime64('2020-10-31T10:05:30.500000')"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nd = np.datetime64(d)  \n",
    "nd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2020, 10, 31, 10, 5, 30, 500000)"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nd.astype(dt.datetime)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numpy.datetime64('2020-10-01')"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nd = np.datetime64('2020-10', 'D')\n",
    "nd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.datetime64('2020-10') == np.datetime64('2020-10-01')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['2020-06-10', '2020-07-10', '2020-08-10'], dtype='datetime64[D]')"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.array(['2020-06-10', '2020-07-10', '2020-08-10'], dtype='datetime64')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['2020-06-10T12:00:00', '2020-07-10T12:00:00',\n",
       "       '2020-08-10T12:00:00'], dtype='datetime64[s]')"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.array(['2020-06-10T12:00:00', '2020-07-10T12:00:00',\n",
    "          '2020-08-10T12:00:00'], dtype='datetime64[s]')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['2020-01-01', '2020-01-02', '2020-01-03'], dtype='datetime64[D]')"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.arange('2020-01-01', '2020-01-04', dtype='datetime64')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['2020-01', '2020-02', '2020-03', '2020-04', '2020-05', '2020-06',\n",
       "       '2020-07', '2020-08', '2020-09'], dtype='datetime64[M]')"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.arange('2020-01-01', '2020-10-01', dtype='datetime64[M]')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['2019-12-26', '2020-01-02', '2020-01-09', '2020-01-16',\n",
       "       '2020-01-23', '2020-01-30', '2020-02-06', '2020-02-13',\n",
       "       '2020-02-20', '2020-02-27'], dtype='datetime64[W]')"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.arange('2020-01-01', '2020-10-01', dtype='datetime64[W]')[:10]  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['2020-01-01T00', '2020-01-01T01', '2020-01-01T02', '2020-01-01T03',\n",
       "       '2020-01-01T04', '2020-01-01T05', '2020-01-01T06', '2020-01-01T07',\n",
       "       '2020-01-01T08', '2020-01-01T09'], dtype='datetime64[h]')"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dtl = np.arange('2020-01-01T00:00:00', '2020-01-02T00:00:00',\n",
    "                dtype='datetime64[h]')  \n",
    "dtl[:10]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['2020-01-01T00:00:00', '2020-01-01T00:00:01',\n",
       "       '2020-01-01T00:00:02', '2020-01-01T00:00:03',\n",
       "       '2020-01-01T00:00:04', '2020-01-01T00:00:05',\n",
       "       '2020-01-01T00:00:06', '2020-01-01T00:00:07',\n",
       "       '2020-01-01T00:00:08', '2020-01-01T00:00:09'],\n",
       "      dtype='datetime64[s]')"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.arange('2020-01-01T00:00:00', '2020-01-02T00:00:00',\n",
    "          dtype='datetime64[s]')[:10]  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['2020-01-01T00:00:00.000', '2020-01-01T00:00:00.001',\n",
       "       '2020-01-01T00:00:00.002', '2020-01-01T00:00:00.003',\n",
       "       '2020-01-01T00:00:00.004', '2020-01-01T00:00:00.005',\n",
       "       '2020-01-01T00:00:00.006', '2020-01-01T00:00:00.007',\n",
       "       '2020-01-01T00:00:00.008', '2020-01-01T00:00:00.009'],\n",
       "      dtype='datetime64[ms]')"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.arange('2020-01-01T00:00:00', '2020-01-02T00:00:00',\n",
    "          dtype='datetime64[ms]')[:10]  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.random.seed(3000)\n",
    "rnd = np.random.standard_normal(len(dtl)).cumsum() ** 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"345.907908pt\" version=\"1.1\" viewBox=\"0 0 598.4875 345.907908\" width=\"598.4875pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-08-08T14:26:00.773623</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.1, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 345.907908 \n",
       "L 598.4875 345.907908 \n",
       "L 598.4875 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 33.2875 300.96 \n",
       "L 591.2875 300.96 \n",
       "L 591.2875 7.2 \n",
       "L 33.2875 7.2 \n",
       "z\n",
       "\" style=\"fill:#eaeaf2;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 58.651136 300.96 \n",
       "L 58.651136 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\"/>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 01-01 00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(18.871541 336.906846)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 219 \n",
       "Q 2513 219 2750 744 \n",
       "Q 2988 1269 2988 2328 \n",
       "Q 2988 3391 2750 3916 \n",
       "Q 2513 4441 2034 4441 \n",
       "Q 1556 4441 1318 3916 \n",
       "Q 1081 3391 1081 2328 \n",
       "Q 1081 1269 1318 744 \n",
       "Q 1556 219 2034 219 \n",
       "z\n",
       "M 2034 -91 \n",
       "Q 1275 -91 848 546 \n",
       "Q 422 1184 422 2328 \n",
       "Q 422 3475 848 4112 \n",
       "Q 1275 4750 2034 4750 \n",
       "Q 2797 4750 3222 4112 \n",
       "Q 3647 3475 3647 2328 \n",
       "Q 3647 1184 3222 546 \n",
       "Q 2797 -91 2034 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-30\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 909 0 \n",
       "L 909 331 \n",
       "L 1722 331 \n",
       "L 1722 4213 \n",
       "L 781 3603 \n",
       "L 781 4013 \n",
       "L 1919 4750 \n",
       "L 2350 4750 \n",
       "L 2350 331 \n",
       "L 3163 331 \n",
       "L 3163 0 \n",
       "L 909 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-31\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 281 1959 \n",
       "L 1881 1959 \n",
       "L 1881 1472 \n",
       "L 281 1472 \n",
       "L 281 1959 \n",
       "z\n",
       "\" id=\"DejaVuSerif-2d\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSerif-20\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"161.035156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"224.658203\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"320.068359\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"383.691406\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 124.817144 300.96 \n",
       "L 124.817144 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\"/>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 01-01 03 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(85.037549 336.906846)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 622 4469 \n",
       "Q 988 4606 1323 4678 \n",
       "Q 1659 4750 1953 4750 \n",
       "Q 2638 4750 3022 4454 \n",
       "Q 3406 4159 3406 3634 \n",
       "Q 3406 3213 3140 2930 \n",
       "Q 2875 2647 2388 2547 \n",
       "Q 2963 2466 3280 2130 \n",
       "Q 3597 1794 3597 1259 \n",
       "Q 3597 606 3158 257 \n",
       "Q 2719 -91 1894 -91 \n",
       "Q 1528 -91 1179 -12 \n",
       "Q 831 66 488 225 \n",
       "L 488 1131 \n",
       "L 838 1131 \n",
       "Q 869 681 1141 450 \n",
       "Q 1413 219 1906 219 \n",
       "Q 2384 219 2661 495 \n",
       "Q 2938 772 2938 1253 \n",
       "Q 2938 1803 2653 2086 \n",
       "Q 2369 2369 1819 2369 \n",
       "L 1522 2369 \n",
       "L 1522 2688 \n",
       "L 1678 2688 \n",
       "Q 2225 2688 2498 2914 \n",
       "Q 2772 3141 2772 3597 \n",
       "Q 2772 4006 2547 4223 \n",
       "Q 2322 4441 1900 4441 \n",
       "Q 1478 4441 1245 4241 \n",
       "Q 1013 4041 972 3647 \n",
       "L 622 3647 \n",
       "L 622 4469 \n",
       "z\n",
       "\" id=\"DejaVuSerif-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"161.035156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"224.658203\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"320.068359\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"383.691406\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 190.983152 300.96 \n",
       "L 190.983152 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\"/>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 01-01 06 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(151.203556 336.906846)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2094 219 \n",
       "Q 2534 219 2771 542 \n",
       "Q 3009 866 3009 1472 \n",
       "Q 3009 2078 2771 2401 \n",
       "Q 2534 2725 2094 2725 \n",
       "Q 1647 2725 1412 2412 \n",
       "Q 1178 2100 1178 1509 \n",
       "Q 1178 888 1415 553 \n",
       "Q 1653 219 2094 219 \n",
       "z\n",
       "M 1075 2569 \n",
       "Q 1288 2803 1556 2918 \n",
       "Q 1825 3034 2163 3034 \n",
       "Q 2859 3034 3264 2615 \n",
       "Q 3669 2197 3669 1472 \n",
       "Q 3669 763 3233 336 \n",
       "Q 2797 -91 2069 -91 \n",
       "Q 1278 -91 853 498 \n",
       "Q 428 1088 428 2181 \n",
       "Q 428 3406 931 4078 \n",
       "Q 1434 4750 2350 4750 \n",
       "Q 2597 4750 2869 4703 \n",
       "Q 3141 4656 3425 4563 \n",
       "L 3425 3794 \n",
       "L 3072 3794 \n",
       "Q 3034 4109 2831 4275 \n",
       "Q 2628 4441 2284 4441 \n",
       "Q 1678 4441 1381 3981 \n",
       "Q 1084 3522 1075 2569 \n",
       "z\n",
       "\" id=\"DejaVuSerif-36\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"161.035156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"224.658203\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"320.068359\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"383.691406\" xlink:href=\"#DejaVuSerif-36\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 257.14916 300.96 \n",
       "L 257.14916 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\"/>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 01-01 09 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(217.369564 336.906846)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2994 2091 \n",
       "Q 2784 1856 2512 1740 \n",
       "Q 2241 1625 1900 1625 \n",
       "Q 1206 1625 804 2044 \n",
       "Q 403 2463 403 3188 \n",
       "Q 403 3897 839 4323 \n",
       "Q 1275 4750 2003 4750 \n",
       "Q 2794 4750 3217 4161 \n",
       "Q 3641 3572 3641 2478 \n",
       "Q 3641 1253 3137 581 \n",
       "Q 2634 -91 1722 -91 \n",
       "Q 1475 -91 1203 -44 \n",
       "Q 931 3 647 97 \n",
       "L 647 872 \n",
       "L 997 872 \n",
       "Q 1038 556 1241 387 \n",
       "Q 1444 219 1784 219 \n",
       "Q 2391 219 2687 676 \n",
       "Q 2984 1134 2994 2091 \n",
       "z\n",
       "M 1978 4441 \n",
       "Q 1534 4441 1298 4117 \n",
       "Q 1063 3794 1063 3188 \n",
       "Q 1063 2581 1298 2256 \n",
       "Q 1534 1931 1978 1931 \n",
       "Q 2422 1931 2658 2245 \n",
       "Q 2894 2559 2894 3150 \n",
       "Q 2894 3772 2656 4106 \n",
       "Q 2419 4441 1978 4441 \n",
       "z\n",
       "\" id=\"DejaVuSerif-39\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"161.035156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"224.658203\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"320.068359\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"383.691406\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 323.315168 300.96 \n",
       "L 323.315168 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\"/>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 01-01 12 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(283.535572 336.906846)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 819 3553 \n",
       "L 469 3553 \n",
       "L 469 4384 \n",
       "Q 803 4563 1142 4656 \n",
       "Q 1481 4750 1806 4750 \n",
       "Q 2534 4750 2956 4397 \n",
       "Q 3378 4044 3378 3438 \n",
       "Q 3378 2753 2422 1800 \n",
       "Q 2347 1728 2309 1691 \n",
       "L 1131 513 \n",
       "L 3078 513 \n",
       "L 3078 1088 \n",
       "L 3444 1088 \n",
       "L 3444 0 \n",
       "L 434 0 \n",
       "L 434 341 \n",
       "L 1850 1753 \n",
       "Q 2319 2222 2519 2614 \n",
       "Q 2719 3006 2719 3438 \n",
       "Q 2719 3909 2473 4175 \n",
       "Q 2228 4441 1797 4441 \n",
       "Q 1350 4441 1106 4219 \n",
       "Q 863 3997 819 3553 \n",
       "z\n",
       "\" id=\"DejaVuSerif-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"161.035156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"224.658203\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"320.068359\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"383.691406\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 389.481176 300.96 \n",
       "L 389.481176 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\"/>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 01-01 15 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(349.70158 336.906846)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3219 4666 \n",
       "L 3219 4153 \n",
       "L 1081 4153 \n",
       "L 1081 2816 \n",
       "Q 1244 2928 1461 2984 \n",
       "Q 1678 3041 1947 3041 \n",
       "Q 2703 3041 3140 2622 \n",
       "Q 3578 2203 3578 1478 \n",
       "Q 3578 738 3136 323 \n",
       "Q 2694 -91 1894 -91 \n",
       "Q 1572 -91 1234 -12 \n",
       "Q 897 66 544 225 \n",
       "L 544 1131 \n",
       "L 897 1131 \n",
       "Q 925 688 1179 453 \n",
       "Q 1434 219 1894 219 \n",
       "Q 2388 219 2653 544 \n",
       "Q 2919 869 2919 1478 \n",
       "Q 2919 2084 2655 2407 \n",
       "Q 2391 2731 1894 2731 \n",
       "Q 1613 2731 1398 2631 \n",
       "Q 1184 2531 1019 2322 \n",
       "L 750 2322 \n",
       "L 750 4666 \n",
       "L 3219 4666 \n",
       "z\n",
       "\" id=\"DejaVuSerif-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"161.035156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"224.658203\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"320.068359\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"383.691406\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 455.647184 300.96 \n",
       "L 455.647184 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\"/>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 01-01 18 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(415.867588 336.906846)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2981 1275 \n",
       "Q 2981 1775 2732 2051 \n",
       "Q 2484 2328 2034 2328 \n",
       "Q 1584 2328 1336 2051 \n",
       "Q 1088 1775 1088 1275 \n",
       "Q 1088 772 1336 495 \n",
       "Q 1584 219 2034 219 \n",
       "Q 2484 219 2732 495 \n",
       "Q 2981 772 2981 1275 \n",
       "z\n",
       "M 2853 3541 \n",
       "Q 2853 3966 2637 4203 \n",
       "Q 2422 4441 2034 4441 \n",
       "Q 1650 4441 1433 4203 \n",
       "Q 1216 3966 1216 3541 \n",
       "Q 1216 3113 1433 2875 \n",
       "Q 1650 2638 2034 2638 \n",
       "Q 2422 2638 2637 2875 \n",
       "Q 2853 3113 2853 3541 \n",
       "z\n",
       "M 2516 2484 \n",
       "Q 3047 2413 3344 2092 \n",
       "Q 3641 1772 3641 1275 \n",
       "Q 3641 619 3225 264 \n",
       "Q 2809 -91 2034 -91 \n",
       "Q 1263 -91 845 264 \n",
       "Q 428 619 428 1275 \n",
       "Q 428 1772 725 2092 \n",
       "Q 1022 2413 1556 2484 \n",
       "Q 1084 2569 832 2842 \n",
       "Q 581 3116 581 3541 \n",
       "Q 581 4103 968 4426 \n",
       "Q 1356 4750 2034 4750 \n",
       "Q 2713 4750 3100 4426 \n",
       "Q 3488 4103 3488 3541 \n",
       "Q 3488 3116 3236 2842 \n",
       "Q 2984 2569 2516 2484 \n",
       "z\n",
       "\" id=\"DejaVuSerif-38\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"161.035156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"224.658203\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"320.068359\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"383.691406\" xlink:href=\"#DejaVuSerif-38\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 521.813192 300.96 \n",
       "L 521.813192 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\"/>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 01-01 21 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(482.033596 336.906846)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"161.035156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"224.658203\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"320.068359\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"383.691406\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_9\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 587.9792 300.96 \n",
       "L 587.9792 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\"/>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 01-02 00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(548.199604 336.906846)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"161.035156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"224.658203\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"320.068359\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"383.691406\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 33.2875 292.782273 \n",
       "L 591.2875 292.782273 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_20\"/>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(19.925 296.581492)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 33.2875 259.591003 \n",
       "L 591.2875 259.591003 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_22\"/>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 25 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(13.5625 263.390222)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_23\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 33.2875 226.399733 \n",
       "L 591.2875 226.399733 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_24\"/>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 50 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(13.5625 230.198952)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_25\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 33.2875 193.208463 \n",
       "L 591.2875 193.208463 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_26\"/>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 75 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(13.5625 197.007682)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3609 4347 \n",
       "L 1784 0 \n",
       "L 1319 0 \n",
       "L 3059 4153 \n",
       "L 903 4153 \n",
       "L 903 3578 \n",
       "L 538 3578 \n",
       "L 538 4666 \n",
       "L 3609 4666 \n",
       "L 3609 4347 \n",
       "z\n",
       "\" id=\"DejaVuSerif-37\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-37\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_27\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 33.2875 160.017193 \n",
       "L 591.2875 160.017193 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_28\"/>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 100 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 163.816412)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_29\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 33.2875 126.825923 \n",
       "L 591.2875 126.825923 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_30\"/>\n",
       "     <g id=\"text_15\">\n",
       "      <!-- 125 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 130.625142)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_31\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 33.2875 93.634653 \n",
       "L 591.2875 93.634653 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_32\"/>\n",
       "     <g id=\"text_16\">\n",
       "      <!-- 150 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 97.433872)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_8\">\n",
       "     <g id=\"line2d_33\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 33.2875 60.443383 \n",
       "L 591.2875 60.443383 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_34\"/>\n",
       "     <g id=\"text_17\">\n",
       "      <!-- 175 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 64.242602)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-37\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_9\">\n",
       "     <g id=\"line2d_35\">\n",
       "      <path clip-path=\"url(#p39a298c1ad)\" d=\"M 33.2875 27.252113 \n",
       "L 591.2875 27.252113 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_36\"/>\n",
       "     <g id=\"text_18\">\n",
       "      <!-- 200 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 31.051332)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_37\">\n",
       "    <path clip-path=\"url(#p39a298c1ad)\" d=\"M 58.651136 283.597613 \n",
       "L 80.706472 281.135459 \n",
       "L 102.761808 287.607273 \n",
       "L 124.817144 279.43404 \n",
       "L 146.87248 261.217087 \n",
       "L 168.927816 259.31752 \n",
       "L 190.983152 262.247117 \n",
       "L 213.038488 259.363046 \n",
       "L 235.093824 226.245807 \n",
       "L 257.14916 174.577886 \n",
       "L 279.204496 108.510018 \n",
       "L 301.259832 137.7094 \n",
       "L 323.315168 143.721058 \n",
       "L 345.370504 157.4407 \n",
       "L 367.42584 184.741007 \n",
       "L 389.481176 219.799562 \n",
       "L 411.536512 191.593652 \n",
       "L 433.591848 160.797814 \n",
       "L 455.647184 87.487523 \n",
       "L 477.70252 146.955043 \n",
       "L 499.757856 109.439575 \n",
       "L 521.813192 81.507449 \n",
       "L 543.868528 79.072708 \n",
       "L 565.923864 20.552727 \n",
       "\" style=\"fill:none;stroke:#4c72b0;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 33.2875 300.96 \n",
       "L 33.2875 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 591.2875 300.96 \n",
       "L 591.2875 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 33.2875 300.96 \n",
       "L 591.2875 300.96 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 33.2875 7.2 \n",
       "L 591.2875 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p39a298c1ad\">\n",
       "   <rect height=\"293.76\" width=\"558\" x=\"33.2875\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig = plt.figure(figsize=(10, 6))\n",
    "plt.plot(dtl.astype(dt.datetime), rnd)  \n",
    "fig.autofmt_xdate();  \n",
    "# plt.savefig('../../images/a_dates/dt_01.png');"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## pandas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2020-06-30 00:00:00')"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts = pd.Timestamp('2020-06-30')  \n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2020, 6, 30, 0, 0)"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d = ts.to_pydatetime()  \n",
    "d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2020-06-30 00:00:00')"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Timestamp(d)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2020-10-01 00:00:00')"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.Timestamp(nd)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2020-01-31', '2020-02-29', '2020-03-31', '2020-04-30',\n",
       "               '2020-05-31', '2020-06-30', '2020-07-31', '2020-08-31',\n",
       "               '2020-09-30', '2020-10-31', '2020-11-30', '2020-12-31'],\n",
       "              dtype='datetime64[ns]', freq='M')"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dti = pd.date_range('2020/01/01', freq='M', periods=12)  \n",
    "dti"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2020-07-31 00:00:00', freq='M')"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dti[6]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([datetime.datetime(2020, 1, 31, 0, 0),\n",
       "       datetime.datetime(2020, 2, 29, 0, 0),\n",
       "       datetime.datetime(2020, 3, 31, 0, 0),\n",
       "       datetime.datetime(2020, 4, 30, 0, 0),\n",
       "       datetime.datetime(2020, 5, 31, 0, 0),\n",
       "       datetime.datetime(2020, 6, 30, 0, 0),\n",
       "       datetime.datetime(2020, 7, 31, 0, 0),\n",
       "       datetime.datetime(2020, 8, 31, 0, 0),\n",
       "       datetime.datetime(2020, 9, 30, 0, 0),\n",
       "       datetime.datetime(2020, 10, 31, 0, 0),\n",
       "       datetime.datetime(2020, 11, 30, 0, 0),\n",
       "       datetime.datetime(2020, 12, 31, 0, 0)], dtype=object)"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pdi = dti.to_pydatetime()  \n",
    "pdi"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2020-01-31', '2020-02-29', '2020-03-31', '2020-04-30',\n",
       "               '2020-05-31', '2020-06-30', '2020-07-31', '2020-08-31',\n",
       "               '2020-09-30', '2020-10-31', '2020-11-30', '2020-12-31'],\n",
       "              dtype='datetime64[ns]', freq=None)"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DatetimeIndex(pdi)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2020-01-01 00:00:00', '2020-01-01 01:00:00',\n",
       "               '2020-01-01 02:00:00', '2020-01-01 03:00:00',\n",
       "               '2020-01-01 04:00:00', '2020-01-01 05:00:00',\n",
       "               '2020-01-01 06:00:00', '2020-01-01 07:00:00',\n",
       "               '2020-01-01 08:00:00', '2020-01-01 09:00:00',\n",
       "               '2020-01-01 10:00:00', '2020-01-01 11:00:00',\n",
       "               '2020-01-01 12:00:00', '2020-01-01 13:00:00',\n",
       "               '2020-01-01 14:00:00', '2020-01-01 15:00:00',\n",
       "               '2020-01-01 16:00:00', '2020-01-01 17:00:00',\n",
       "               '2020-01-01 18:00:00', '2020-01-01 19:00:00',\n",
       "               '2020-01-01 20:00:00', '2020-01-01 21:00:00',\n",
       "               '2020-01-01 22:00:00', '2020-01-01 23:00:00'],\n",
       "              dtype='datetime64[ns]', freq=None)"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.DatetimeIndex(dtl)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [],
   "source": [
    "rnd = np.random.standard_normal(len(dti)).cumsum() ** 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(rnd, columns=['data'], index=dti)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"368.435938pt\" version=\"1.1\" viewBox=\"0 0 601.892969 368.435938\" width=\"601.892969pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-08-08T14:26:01.102755</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.1, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 368.435938 \n",
       "L 601.892969 368.435938 \n",
       "L 601.892969 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 26.925 333.36 \n",
       "L 584.925 333.36 \n",
       "L 584.925 7.2 \n",
       "L 26.925 7.2 \n",
       "z\n",
       "\" style=\"fill:#eaeaf2;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#p10f0aaea57)\" d=\"M 26.925 333.36 \n",
       "L 26.925 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\"/>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- Jan -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(18.71875 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M -538 -1119 \n",
       "L -538 -384 \n",
       "L -181 -384 \n",
       "Q -172 -694 -34 -845 \n",
       "Q 103 -997 378 -997 \n",
       "Q 750 -997 897 -762 \n",
       "Q 1044 -528 1044 153 \n",
       "L 1044 4331 \n",
       "L 319 4331 \n",
       "L 319 4666 \n",
       "L 2272 4666 \n",
       "L 2272 4331 \n",
       "L 1678 4331 \n",
       "L 1678 128 \n",
       "Q 1678 -644 1368 -987 \n",
       "Q 1059 -1331 372 -1331 \n",
       "Q 150 -1331 -79 -1278 \n",
       "Q -309 -1225 -538 -1119 \n",
       "z\n",
       "\" id=\"DejaVuSerif-4a\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2547 1044 \n",
       "L 2547 1747 \n",
       "L 1806 1747 \n",
       "Q 1378 1747 1168 1562 \n",
       "Q 959 1378 959 997 \n",
       "Q 959 650 1171 447 \n",
       "Q 1384 244 1747 244 \n",
       "Q 2106 244 2326 466 \n",
       "Q 2547 688 2547 1044 \n",
       "z\n",
       "M 3122 2075 \n",
       "L 3122 331 \n",
       "L 3634 331 \n",
       "L 3634 0 \n",
       "L 2547 0 \n",
       "L 2547 359 \n",
       "Q 2356 128 2106 18 \n",
       "Q 1856 -91 1522 -91 \n",
       "Q 969 -91 644 203 \n",
       "Q 319 497 319 997 \n",
       "Q 319 1513 691 1797 \n",
       "Q 1063 2081 1741 2081 \n",
       "L 2547 2081 \n",
       "L 2547 2309 \n",
       "Q 2547 2688 2317 2895 \n",
       "Q 2088 3103 1672 3103 \n",
       "Q 1328 3103 1125 2947 \n",
       "Q 922 2791 872 2484 \n",
       "L 575 2484 \n",
       "L 575 3156 \n",
       "Q 875 3284 1158 3348 \n",
       "Q 1441 3413 1709 3413 \n",
       "Q 2400 3413 2761 3070 \n",
       "Q 3122 2728 3122 2075 \n",
       "z\n",
       "\" id=\"DejaVuSerif-61\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 263 0 \n",
       "L 263 331 \n",
       "L 781 331 \n",
       "L 781 2988 \n",
       "L 231 2988 \n",
       "L 231 3322 \n",
       "L 1356 3322 \n",
       "L 1356 2731 \n",
       "Q 1516 3069 1770 3241 \n",
       "Q 2025 3413 2363 3413 \n",
       "Q 2913 3413 3172 3097 \n",
       "Q 3431 2781 3431 2113 \n",
       "L 3431 331 \n",
       "L 3944 331 \n",
       "L 3944 0 \n",
       "L 2356 0 \n",
       "L 2356 331 \n",
       "L 2853 331 \n",
       "L 2853 1931 \n",
       "Q 2853 2541 2703 2767 \n",
       "Q 2553 2994 2175 2994 \n",
       "Q 1775 2994 1565 2701 \n",
       "Q 1356 2409 1356 1850 \n",
       "L 1356 331 \n",
       "L 1856 331 \n",
       "L 1856 0 \n",
       "L 263 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6e\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4a\"/>\n",
       "       <use x=\"40.087891\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "       <use x=\"99.707031\" xlink:href=\"#DejaVuSerif-6e\"/>\n",
       "      </g>\n",
       "      <!-- 2020 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(14.2 359.15625)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 819 3553 \n",
       "L 469 3553 \n",
       "L 469 4384 \n",
       "Q 803 4563 1142 4656 \n",
       "Q 1481 4750 1806 4750 \n",
       "Q 2534 4750 2956 4397 \n",
       "Q 3378 4044 3378 3438 \n",
       "Q 3378 2753 2422 1800 \n",
       "Q 2347 1728 2309 1691 \n",
       "L 1131 513 \n",
       "L 3078 513 \n",
       "L 3078 1088 \n",
       "L 3444 1088 \n",
       "L 3444 0 \n",
       "L 434 0 \n",
       "L 434 341 \n",
       "L 1850 1753 \n",
       "Q 2319 2222 2519 2614 \n",
       "Q 2719 3006 2719 3438 \n",
       "Q 2719 3909 2473 4175 \n",
       "Q 2228 4441 1797 4441 \n",
       "Q 1350 4441 1106 4219 \n",
       "Q 863 3997 819 3553 \n",
       "z\n",
       "\" id=\"DejaVuSerif-32\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2034 219 \n",
       "Q 2513 219 2750 744 \n",
       "Q 2988 1269 2988 2328 \n",
       "Q 2988 3391 2750 3916 \n",
       "Q 2513 4441 2034 4441 \n",
       "Q 1556 4441 1318 3916 \n",
       "Q 1081 3391 1081 2328 \n",
       "Q 1081 1269 1318 744 \n",
       "Q 1556 219 2034 219 \n",
       "z\n",
       "M 2034 -91 \n",
       "Q 1275 -91 848 546 \n",
       "Q 422 1184 422 2328 \n",
       "Q 422 3475 848 4112 \n",
       "Q 1275 4750 2034 4750 \n",
       "Q 2797 4750 3222 4112 \n",
       "Q 3647 3475 3647 2328 \n",
       "Q 3647 1184 3222 546 \n",
       "Q 2797 -91 2034 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\"/>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- Feb -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(68.297585 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 353 0 \n",
       "L 353 331 \n",
       "L 947 331 \n",
       "L 947 4331 \n",
       "L 353 4331 \n",
       "L 353 4666 \n",
       "L 4172 4666 \n",
       "L 4172 3628 \n",
       "L 3788 3628 \n",
       "L 3788 4281 \n",
       "L 1581 4281 \n",
       "L 1581 2719 \n",
       "L 3175 2719 \n",
       "L 3175 3303 \n",
       "L 3559 3303 \n",
       "L 3559 1753 \n",
       "L 3175 1753 \n",
       "L 3175 2338 \n",
       "L 1581 2338 \n",
       "L 1581 331 \n",
       "L 2328 331 \n",
       "L 2328 0 \n",
       "L 353 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-46\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 3469 1600 \n",
       "L 991 1600 \n",
       "L 991 1575 \n",
       "Q 991 903 1244 561 \n",
       "Q 1497 219 1991 219 \n",
       "Q 2369 219 2611 417 \n",
       "Q 2853 616 2950 1006 \n",
       "L 3413 1006 \n",
       "Q 3275 459 2904 184 \n",
       "Q 2534 -91 1931 -91 \n",
       "Q 1203 -91 761 389 \n",
       "Q 319 869 319 1663 \n",
       "Q 319 2450 753 2931 \n",
       "Q 1188 3413 1894 3413 \n",
       "Q 2647 3413 3050 2948 \n",
       "Q 3453 2484 3469 1600 \n",
       "z\n",
       "M 2791 1931 \n",
       "Q 2772 2513 2545 2808 \n",
       "Q 2319 3103 1894 3103 \n",
       "Q 1497 3103 1269 2806 \n",
       "Q 1041 2509 991 1931 \n",
       "L 2791 1931 \n",
       "z\n",
       "\" id=\"DejaVuSerif-65\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 738 331 \n",
       "L 738 4531 \n",
       "L 184 4531 \n",
       "L 184 4863 \n",
       "L 1313 4863 \n",
       "L 1313 2803 \n",
       "Q 1481 3116 1742 3264 \n",
       "Q 2003 3413 2388 3413 \n",
       "Q 3000 3413 3387 2928 \n",
       "Q 3775 2444 3775 1663 \n",
       "Q 3775 881 3387 395 \n",
       "Q 3000 -91 2388 -91 \n",
       "Q 2003 -91 1742 57 \n",
       "Q 1481 206 1313 519 \n",
       "L 1313 0 \n",
       "L 184 0 \n",
       "L 184 331 \n",
       "L 738 331 \n",
       "z\n",
       "M 1313 1497 \n",
       "Q 1313 897 1542 583 \n",
       "Q 1772 269 2209 269 \n",
       "Q 2650 269 2876 622 \n",
       "Q 3103 975 3103 1663 \n",
       "Q 3103 2353 2876 2703 \n",
       "Q 2650 3053 2209 3053 \n",
       "Q 1772 3053 1542 2737 \n",
       "Q 1313 2422 1313 1825 \n",
       "L 1313 1497 \n",
       "z\n",
       "\" id=\"DejaVuSerif-62\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-46\"/>\n",
       "       <use x=\"63.884766\" xlink:href=\"#DejaVuSerif-65\"/>\n",
       "       <use x=\"123.064453\" xlink:href=\"#DejaVuSerif-62\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_4\"/>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- Mar -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(117.88892 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 353 0 \n",
       "L 353 331 \n",
       "L 947 331 \n",
       "L 947 4331 \n",
       "L 319 4331 \n",
       "L 319 4666 \n",
       "L 1678 4666 \n",
       "L 3316 1344 \n",
       "L 4953 4666 \n",
       "L 6228 4666 \n",
       "L 6228 4331 \n",
       "L 5606 4331 \n",
       "L 5606 331 \n",
       "L 6203 331 \n",
       "L 6203 0 \n",
       "L 4378 0 \n",
       "L 4378 331 \n",
       "L 4972 331 \n",
       "L 4972 3938 \n",
       "L 3372 684 \n",
       "L 2931 684 \n",
       "L 1331 3938 \n",
       "L 1331 331 \n",
       "L 1925 331 \n",
       "L 1925 0 \n",
       "L 353 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-4d\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 3059 3328 \n",
       "L 3059 2497 \n",
       "L 2728 2497 \n",
       "Q 2713 2744 2591 2866 \n",
       "Q 2469 2988 2234 2988 \n",
       "Q 1809 2988 1582 2694 \n",
       "Q 1356 2400 1356 1850 \n",
       "L 1356 331 \n",
       "L 2022 331 \n",
       "L 2022 0 \n",
       "L 263 0 \n",
       "L 263 331 \n",
       "L 781 331 \n",
       "L 781 2994 \n",
       "L 231 2994 \n",
       "L 231 3322 \n",
       "L 1356 3322 \n",
       "L 1356 2731 \n",
       "Q 1525 3078 1790 3245 \n",
       "Q 2056 3413 2438 3413 \n",
       "Q 2578 3413 2733 3391 \n",
       "Q 2888 3369 3059 3328 \n",
       "z\n",
       "\" id=\"DejaVuSerif-72\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4d\"/>\n",
       "       <use x=\"102.392578\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "       <use x=\"162.011719\" xlink:href=\"#DejaVuSerif-72\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_5\"/>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- Apr -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(169.905256 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1281 1691 \n",
       "L 2994 1691 \n",
       "L 2138 3909 \n",
       "L 1281 1691 \n",
       "z\n",
       "M -38 0 \n",
       "L -38 331 \n",
       "L 372 331 \n",
       "L 2034 4666 \n",
       "L 2559 4666 \n",
       "L 4225 331 \n",
       "L 4684 331 \n",
       "L 4684 0 \n",
       "L 2988 0 \n",
       "L 2988 331 \n",
       "L 3506 331 \n",
       "L 3116 1356 \n",
       "L 1153 1356 \n",
       "L 763 331 \n",
       "L 1275 331 \n",
       "L 1275 0 \n",
       "L -38 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-41\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 1313 1825 \n",
       "L 1313 1497 \n",
       "Q 1313 897 1542 583 \n",
       "Q 1772 269 2209 269 \n",
       "Q 2650 269 2876 622 \n",
       "Q 3103 975 3103 1663 \n",
       "Q 3103 2353 2876 2703 \n",
       "Q 2650 3053 2209 3053 \n",
       "Q 1772 3053 1542 2737 \n",
       "Q 1313 2422 1313 1825 \n",
       "z\n",
       "M 738 2988 \n",
       "L 184 2988 \n",
       "L 184 3322 \n",
       "L 1313 3322 \n",
       "L 1313 2803 \n",
       "Q 1481 3116 1742 3264 \n",
       "Q 2003 3413 2388 3413 \n",
       "Q 3000 3413 3387 2928 \n",
       "Q 3775 2444 3775 1663 \n",
       "Q 3775 881 3387 395 \n",
       "Q 3000 -91 2388 -91 \n",
       "Q 2003 -91 1742 57 \n",
       "Q 1481 206 1313 519 \n",
       "L 1313 -997 \n",
       "L 1856 -997 \n",
       "L 1856 -1331 \n",
       "L 184 -1331 \n",
       "L 184 -997 \n",
       "L 738 -997 \n",
       "L 738 2988 \n",
       "z\n",
       "\" id=\"DejaVuSerif-70\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-41\"/>\n",
       "       <use x=\"72.216797\" xlink:href=\"#DejaVuSerif-70\"/>\n",
       "       <use x=\"136.230469\" xlink:href=\"#DejaVuSerif-72\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_6\"/>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- May -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(218.90831 344.21625)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1381 -609 \n",
       "L 1600 -56 \n",
       "L 359 2988 \n",
       "L -19 2988 \n",
       "L -19 3322 \n",
       "L 1509 3322 \n",
       "L 1509 2988 \n",
       "L 978 2988 \n",
       "L 1913 703 \n",
       "L 2847 2988 \n",
       "L 2350 2988 \n",
       "L 2350 3322 \n",
       "L 3597 3322 \n",
       "L 3597 2988 \n",
       "L 3225 2988 \n",
       "L 1703 -750 \n",
       "Q 1547 -1138 1356 -1280 \n",
       "Q 1166 -1422 819 -1422 \n",
       "Q 672 -1422 517 -1397 \n",
       "Q 363 -1372 206 -1325 \n",
       "L 206 -691 \n",
       "L 500 -691 \n",
       "Q 519 -903 608 -995 \n",
       "Q 697 -1088 884 -1088 \n",
       "Q 1056 -1088 1161 -992 \n",
       "Q 1266 -897 1381 -609 \n",
       "z\n",
       "\" id=\"DejaVuSerif-79\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4d\"/>\n",
       "       <use x=\"102.392578\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "       <use x=\"162.011719\" xlink:href=\"#DejaVuSerif-79\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_7\"/>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- Jun -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(272.116051 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2266 3322 \n",
       "L 3341 3322 \n",
       "L 3341 331 \n",
       "L 3884 331 \n",
       "L 3884 0 \n",
       "L 2766 0 \n",
       "L 2766 588 \n",
       "Q 2606 256 2353 82 \n",
       "Q 2100 -91 1766 -91 \n",
       "Q 1213 -91 952 223 \n",
       "Q 691 538 691 1209 \n",
       "L 691 2988 \n",
       "L 172 2988 \n",
       "L 172 3322 \n",
       "L 1269 3322 \n",
       "L 1269 1388 \n",
       "Q 1269 781 1417 556 \n",
       "Q 1566 331 1947 331 \n",
       "Q 2347 331 2556 625 \n",
       "Q 2766 919 2766 1478 \n",
       "L 2766 2988 \n",
       "L 2266 2988 \n",
       "L 2266 3322 \n",
       "z\n",
       "\" id=\"DejaVuSerif-75\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4a\"/>\n",
       "       <use x=\"40.087891\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "       <use x=\"104.492188\" xlink:href=\"#DejaVuSerif-6e\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_8\"/>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- Jul -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(324.464418 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1313 331 \n",
       "L 1856 331 \n",
       "L 1856 0 \n",
       "L 184 0 \n",
       "L 184 331 \n",
       "L 738 331 \n",
       "L 738 4531 \n",
       "L 184 4531 \n",
       "L 184 4863 \n",
       "L 1313 4863 \n",
       "L 1313 331 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6c\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4a\"/>\n",
       "       <use x=\"40.087891\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "       <use x=\"104.492188\" xlink:href=\"#DejaVuSerif-6c\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_9\"/>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- Aug -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(371.983878 344.21625)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3359 2988 \n",
       "L 3359 72 \n",
       "Q 3359 -644 2965 -1033 \n",
       "Q 2572 -1422 1844 -1422 \n",
       "Q 1516 -1422 1216 -1362 \n",
       "Q 916 -1303 641 -1184 \n",
       "L 641 -488 \n",
       "L 941 -488 \n",
       "Q 997 -813 1206 -963 \n",
       "Q 1416 -1113 1806 -1113 \n",
       "Q 2313 -1113 2548 -827 \n",
       "Q 2784 -541 2784 72 \n",
       "L 2784 519 \n",
       "Q 2616 206 2355 57 \n",
       "Q 2094 -91 1709 -91 \n",
       "Q 1097 -91 708 395 \n",
       "Q 319 881 319 1663 \n",
       "Q 319 2444 706 2928 \n",
       "Q 1094 3413 1709 3413 \n",
       "Q 2094 3413 2355 3264 \n",
       "Q 2616 3116 2784 2803 \n",
       "L 2784 3322 \n",
       "L 3909 3322 \n",
       "L 3909 2988 \n",
       "L 3359 2988 \n",
       "z\n",
       "M 2784 1825 \n",
       "Q 2784 2422 2554 2737 \n",
       "Q 2325 3053 1888 3053 \n",
       "Q 1444 3053 1217 2703 \n",
       "Q 991 2353 991 1663 \n",
       "Q 991 975 1217 622 \n",
       "Q 1444 269 1888 269 \n",
       "Q 2325 269 2554 583 \n",
       "Q 2784 897 2784 1497 \n",
       "L 2784 1825 \n",
       "z\n",
       "\" id=\"DejaVuSerif-67\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-41\"/>\n",
       "       <use x=\"72.216797\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "       <use x=\"136.621094\" xlink:href=\"#DejaVuSerif-67\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_9\">\n",
       "     <g id=\"line2d_10\"/>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- Sep -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(423.158026 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 594 225 \n",
       "L 594 1288 \n",
       "L 953 1284 \n",
       "Q 969 753 1261 498 \n",
       "Q 1553 244 2150 244 \n",
       "Q 2706 244 2998 464 \n",
       "Q 3291 684 3291 1106 \n",
       "Q 3291 1444 3114 1625 \n",
       "Q 2938 1806 2369 1978 \n",
       "L 1753 2163 \n",
       "Q 1084 2366 811 2669 \n",
       "Q 538 2972 538 3500 \n",
       "Q 538 4094 959 4422 \n",
       "Q 1381 4750 2144 4750 \n",
       "Q 2469 4750 2856 4679 \n",
       "Q 3244 4609 3681 4475 \n",
       "L 3681 3481 \n",
       "L 3328 3481 \n",
       "Q 3275 3975 2998 4195 \n",
       "Q 2722 4416 2156 4416 \n",
       "Q 1663 4416 1405 4214 \n",
       "Q 1147 4013 1147 3628 \n",
       "Q 1147 3294 1340 3103 \n",
       "Q 1534 2913 2163 2725 \n",
       "L 2741 2553 \n",
       "Q 3375 2363 3645 2067 \n",
       "Q 3916 1772 3916 1275 \n",
       "Q 3916 597 3481 253 \n",
       "Q 3047 -91 2188 -91 \n",
       "Q 1803 -91 1404 -12 \n",
       "Q 1006 66 594 225 \n",
       "z\n",
       "\" id=\"DejaVuSerif-53\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-53\"/>\n",
       "       <use x=\"68.505859\" xlink:href=\"#DejaVuSerif-65\"/>\n",
       "       <use x=\"127.685547\" xlink:href=\"#DejaVuSerif-70\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_10\">\n",
       "     <g id=\"line2d_11\"/>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- Oct -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(474.561861 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2625 244 \n",
       "Q 3391 244 3781 770 \n",
       "Q 4172 1297 4172 2328 \n",
       "Q 4172 3363 3781 3889 \n",
       "Q 3391 4416 2625 4416 \n",
       "Q 1856 4416 1465 3889 \n",
       "Q 1075 3363 1075 2328 \n",
       "Q 1075 1297 1465 770 \n",
       "Q 1856 244 2625 244 \n",
       "z\n",
       "M 2625 -91 \n",
       "Q 2150 -91 1751 65 \n",
       "Q 1353 222 1050 525 \n",
       "Q 700 875 529 1319 \n",
       "Q 359 1763 359 2328 \n",
       "Q 359 2894 529 3339 \n",
       "Q 700 3784 1050 4134 \n",
       "Q 1356 4441 1750 4595 \n",
       "Q 2144 4750 2625 4750 \n",
       "Q 3641 4750 4266 4084 \n",
       "Q 4891 3419 4891 2328 \n",
       "Q 4891 1769 4719 1320 \n",
       "Q 4547 872 4197 525 \n",
       "Q 3891 219 3497 64 \n",
       "Q 3103 -91 2625 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-4f\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 3291 997 \n",
       "Q 3169 466 2822 187 \n",
       "Q 2475 -91 1925 -91 \n",
       "Q 1200 -91 759 389 \n",
       "Q 319 869 319 1663 \n",
       "Q 319 2459 759 2936 \n",
       "Q 1200 3413 1925 3413 \n",
       "Q 2241 3413 2553 3339 \n",
       "Q 2866 3266 3181 3116 \n",
       "L 3181 2266 \n",
       "L 2847 2266 \n",
       "Q 2781 2703 2561 2903 \n",
       "Q 2341 3103 1931 3103 \n",
       "Q 1466 3103 1228 2742 \n",
       "Q 991 2381 991 1663 \n",
       "Q 991 944 1227 581 \n",
       "Q 1463 219 1931 219 \n",
       "Q 2303 219 2525 412 \n",
       "Q 2747 606 2828 997 \n",
       "L 3291 997 \n",
       "z\n",
       "\" id=\"DejaVuSerif-63\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 691 2988 \n",
       "L 184 2988 \n",
       "L 184 3322 \n",
       "L 691 3322 \n",
       "L 691 4353 \n",
       "L 1269 4353 \n",
       "L 1269 3322 \n",
       "L 2350 3322 \n",
       "L 2350 2988 \n",
       "L 1269 2988 \n",
       "L 1269 878 \n",
       "Q 1269 456 1350 337 \n",
       "Q 1431 219 1650 219 \n",
       "Q 1875 219 1978 351 \n",
       "Q 2081 484 2088 781 \n",
       "L 2522 781 \n",
       "Q 2497 328 2275 118 \n",
       "Q 2053 -91 1600 -91 \n",
       "Q 1103 -91 897 129 \n",
       "Q 691 350 691 878 \n",
       "L 691 2988 \n",
       "z\n",
       "\" id=\"DejaVuSerif-74\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4f\"/>\n",
       "       <use x=\"81.982422\" xlink:href=\"#DejaVuSerif-63\"/>\n",
       "       <use x=\"137.988281\" xlink:href=\"#DejaVuSerif-74\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_11\">\n",
       "     <g id=\"line2d_12\"/>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- Nov -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(523.987571 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 313 0 \n",
       "L 313 331 \n",
       "L 941 331 \n",
       "L 941 4331 \n",
       "L 313 4331 \n",
       "L 313 4666 \n",
       "L 1509 4666 \n",
       "L 4306 984 \n",
       "L 4306 4331 \n",
       "L 3681 4331 \n",
       "L 3681 4666 \n",
       "L 5319 4666 \n",
       "L 5319 4331 \n",
       "L 4691 4331 \n",
       "L 4691 -91 \n",
       "L 4313 -91 \n",
       "L 1325 3841 \n",
       "L 1325 331 \n",
       "L 1953 331 \n",
       "L 1953 0 \n",
       "L 313 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-4e\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 1925 219 \n",
       "Q 2388 219 2623 584 \n",
       "Q 2859 950 2859 1663 \n",
       "Q 2859 2375 2623 2739 \n",
       "Q 2388 3103 1925 3103 \n",
       "Q 1463 3103 1227 2739 \n",
       "Q 991 2375 991 1663 \n",
       "Q 991 950 1228 584 \n",
       "Q 1466 219 1925 219 \n",
       "z\n",
       "M 1925 -91 \n",
       "Q 1200 -91 759 389 \n",
       "Q 319 869 319 1663 \n",
       "Q 319 2456 758 2934 \n",
       "Q 1197 3413 1925 3413 \n",
       "Q 2653 3413 3092 2934 \n",
       "Q 3531 2456 3531 1663 \n",
       "Q 3531 869 3092 389 \n",
       "Q 2653 -91 1925 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6f\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 1581 0 \n",
       "L 359 2988 \n",
       "L -19 2988 \n",
       "L -19 3322 \n",
       "L 1509 3322 \n",
       "L 1509 2988 \n",
       "L 978 2988 \n",
       "L 1913 703 \n",
       "L 2847 2988 \n",
       "L 2350 2988 \n",
       "L 2350 3322 \n",
       "L 3597 3322 \n",
       "L 3597 2988 \n",
       "L 3225 2988 \n",
       "L 2003 0 \n",
       "L 1581 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-76\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4e\"/>\n",
       "       <use x=\"87.5\" xlink:href=\"#DejaVuSerif-6f\"/>\n",
       "       <use x=\"147.705078\" xlink:href=\"#DejaVuSerif-76\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_12\">\n",
       "     <g id=\"line2d_13\"/>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- Dec -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(575.157031 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1581 331 \n",
       "L 2163 331 \n",
       "Q 3072 331 3558 850 \n",
       "Q 4044 1369 4044 2338 \n",
       "Q 4044 3306 3559 3818 \n",
       "Q 3075 4331 2163 4331 \n",
       "L 1581 4331 \n",
       "L 1581 331 \n",
       "z\n",
       "M 353 0 \n",
       "L 353 331 \n",
       "L 947 331 \n",
       "L 947 4331 \n",
       "L 353 4331 \n",
       "L 353 4666 \n",
       "L 2209 4666 \n",
       "Q 3416 4666 4089 4050 \n",
       "Q 4763 3434 4763 2338 \n",
       "Q 4763 1238 4088 619 \n",
       "Q 3413 0 2209 0 \n",
       "L 353 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-44\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-44\"/>\n",
       "       <use x=\"80.175781\" xlink:href=\"#DejaVuSerif-65\"/>\n",
       "       <use x=\"139.355469\" xlink:href=\"#DejaVuSerif-63\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_14\">\n",
       "      <path clip-path=\"url(#p10f0aaea57)\" d=\"M 26.925 318.950763 \n",
       "L 584.925 318.950763 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_15\"/>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(13.5625 322.749981)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_16\">\n",
       "      <path clip-path=\"url(#p10f0aaea57)\" d=\"M 26.925 270.476437 \n",
       "L 584.925 270.476437 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_17\"/>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 5 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(13.5625 274.275656)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3219 4666 \n",
       "L 3219 4153 \n",
       "L 1081 4153 \n",
       "L 1081 2816 \n",
       "Q 1244 2928 1461 2984 \n",
       "Q 1678 3041 1947 3041 \n",
       "Q 2703 3041 3140 2622 \n",
       "Q 3578 2203 3578 1478 \n",
       "Q 3578 738 3136 323 \n",
       "Q 2694 -91 1894 -91 \n",
       "Q 1572 -91 1234 -12 \n",
       "Q 897 66 544 225 \n",
       "L 544 1131 \n",
       "L 897 1131 \n",
       "Q 925 688 1179 453 \n",
       "Q 1434 219 1894 219 \n",
       "Q 2388 219 2653 544 \n",
       "Q 2919 869 2919 1478 \n",
       "Q 2919 2084 2655 2407 \n",
       "Q 2391 2731 1894 2731 \n",
       "Q 1613 2731 1398 2631 \n",
       "Q 1184 2531 1019 2322 \n",
       "L 750 2322 \n",
       "L 750 4666 \n",
       "L 3219 4666 \n",
       "z\n",
       "\" id=\"DejaVuSerif-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_18\">\n",
       "      <path clip-path=\"url(#p10f0aaea57)\" d=\"M 26.925 222.002112 \n",
       "L 584.925 222.002112 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_19\"/>\n",
       "     <g id=\"text_15\">\n",
       "      <!-- 10 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 225.801331)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 909 0 \n",
       "L 909 331 \n",
       "L 1722 331 \n",
       "L 1722 4213 \n",
       "L 781 3603 \n",
       "L 781 4013 \n",
       "L 1919 4750 \n",
       "L 2350 4750 \n",
       "L 2350 331 \n",
       "L 3163 331 \n",
       "L 3163 0 \n",
       "L 909 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_20\">\n",
       "      <path clip-path=\"url(#p10f0aaea57)\" d=\"M 26.925 173.527787 \n",
       "L 584.925 173.527787 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_21\"/>\n",
       "     <g id=\"text_16\">\n",
       "      <!-- 15 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 177.327006)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_22\">\n",
       "      <path clip-path=\"url(#p10f0aaea57)\" d=\"M 26.925 125.053462 \n",
       "L 584.925 125.053462 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_23\"/>\n",
       "     <g id=\"text_17\">\n",
       "      <!-- 20 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 128.852681)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_24\">\n",
       "      <path clip-path=\"url(#p10f0aaea57)\" d=\"M 26.925 76.579137 \n",
       "L 584.925 76.579137 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_25\"/>\n",
       "     <g id=\"text_18\">\n",
       "      <!-- 25 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 80.378356)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_26\">\n",
       "      <path clip-path=\"url(#p10f0aaea57)\" d=\"M 26.925 28.104812 \n",
       "L 584.925 28.104812 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_27\"/>\n",
       "     <g id=\"text_19\">\n",
       "      <!-- 30 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 31.904031)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 622 4469 \n",
       "Q 988 4606 1323 4678 \n",
       "Q 1659 4750 1953 4750 \n",
       "Q 2638 4750 3022 4454 \n",
       "Q 3406 4159 3406 3634 \n",
       "Q 3406 3213 3140 2930 \n",
       "Q 2875 2647 2388 2547 \n",
       "Q 2963 2466 3280 2130 \n",
       "Q 3597 1794 3597 1259 \n",
       "Q 3597 606 3158 257 \n",
       "Q 2719 -91 1894 -91 \n",
       "Q 1528 -91 1179 -12 \n",
       "Q 831 66 488 225 \n",
       "L 488 1131 \n",
       "L 838 1131 \n",
       "Q 869 681 1141 450 \n",
       "Q 1413 219 1906 219 \n",
       "Q 2384 219 2661 495 \n",
       "Q 2938 772 2938 1253 \n",
       "Q 2938 1803 2653 2086 \n",
       "Q 2369 2369 1819 2369 \n",
       "L 1522 2369 \n",
       "L 1522 2688 \n",
       "L 1678 2688 \n",
       "Q 2225 2688 2498 2914 \n",
       "Q 2772 3141 2772 3597 \n",
       "Q 2772 4006 2547 4223 \n",
       "Q 2322 4441 1900 4441 \n",
       "Q 1478 4441 1245 4241 \n",
       "Q 1013 4041 972 3647 \n",
       "L 622 3647 \n",
       "L 622 4469 \n",
       "z\n",
       "\" id=\"DejaVuSerif-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_28\">\n",
       "    <path clip-path=\"url(#p10f0aaea57)\" d=\"M 26.925 313.429624 \n",
       "L 77.652273 318.534545 \n",
       "L 128.379545 305.616199 \n",
       "L 179.106818 252.950882 \n",
       "L 229.834091 303.686474 \n",
       "L 280.561364 258.256604 \n",
       "L 331.288636 247.600895 \n",
       "L 382.015909 201.955165 \n",
       "L 432.743182 200.934744 \n",
       "L 483.470455 223.167898 \n",
       "L 534.197727 153.92215 \n",
       "L 584.925 22.025455 \n",
       "\" style=\"fill:none;stroke:#4c72b0;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 26.925 333.36 \n",
       "L 26.925 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 584.925 333.36 \n",
       "L 584.925 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 26.925 333.36 \n",
       "L 584.925 333.36 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 26.925 7.2 \n",
       "L 584.925 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"line2d_29\">\n",
       "     <path d=\"M 525.579687 20.298438 \n",
       "L 545.579687 20.298438 \n",
       "\" style=\"fill:none;stroke:#4c72b0;stroke-linecap:round;stroke-width:1.75;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_30\"/>\n",
       "    <g id=\"text_20\">\n",
       "     <!-- data -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(553.579687 23.798438)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 3359 331 \n",
       "L 3909 331 \n",
       "L 3909 0 \n",
       "L 2784 0 \n",
       "L 2784 519 \n",
       "Q 2616 206 2355 57 \n",
       "Q 2094 -91 1709 -91 \n",
       "Q 1097 -91 708 395 \n",
       "Q 319 881 319 1663 \n",
       "Q 319 2444 706 2928 \n",
       "Q 1094 3413 1709 3413 \n",
       "Q 2094 3413 2355 3264 \n",
       "Q 2616 3116 2784 2803 \n",
       "L 2784 4531 \n",
       "L 2241 4531 \n",
       "L 2241 4863 \n",
       "L 3359 4863 \n",
       "L 3359 331 \n",
       "z\n",
       "M 2784 1497 \n",
       "L 2784 1825 \n",
       "Q 2784 2422 2554 2737 \n",
       "Q 2325 3053 1888 3053 \n",
       "Q 1444 3053 1217 2703 \n",
       "Q 991 2353 991 1663 \n",
       "Q 991 975 1217 622 \n",
       "Q 1444 269 1888 269 \n",
       "Q 2325 269 2554 583 \n",
       "Q 2784 897 2784 1497 \n",
       "z\n",
       "\" id=\"DejaVuSerif-64\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSerif-64\"/>\n",
       "      <use x=\"64.013672\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "      <use x=\"123.632812\" xlink:href=\"#DejaVuSerif-74\"/>\n",
       "      <use x=\"163.818359\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p10f0aaea57\">\n",
       "   <rect height=\"326.16\" width=\"558\" x=\"26.925\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "df.plot(figsize=(10, 6));\n",
    "# plt.savefig('../../images/a_dates/dt_02.png');"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2020-01-31 00:00:00+01:00', '2020-02-29 00:00:00+01:00',\n",
       "               '2020-03-31 00:00:00+02:00', '2020-04-30 00:00:00+02:00',\n",
       "               '2020-05-31 00:00:00+02:00', '2020-06-30 00:00:00+02:00',\n",
       "               '2020-07-31 00:00:00+02:00', '2020-08-31 00:00:00+02:00',\n",
       "               '2020-09-30 00:00:00+02:00', '2020-10-31 00:00:00+01:00',\n",
       "               '2020-11-30 00:00:00+01:00', '2020-12-31 00:00:00+01:00'],\n",
       "              dtype='datetime64[ns, CET]', freq='M')"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.date_range('2020/01/01', freq='M', periods=12, tz=pytz.timezone('CET'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2020-01-31 00:00:00-05:00', '2020-02-29 00:00:00-05:00',\n",
       "               '2020-03-31 00:00:00-04:00', '2020-04-30 00:00:00-04:00',\n",
       "               '2020-05-31 00:00:00-04:00', '2020-06-30 00:00:00-04:00',\n",
       "               '2020-07-31 00:00:00-04:00', '2020-08-31 00:00:00-04:00',\n",
       "               '2020-09-30 00:00:00-04:00', '2020-10-31 00:00:00-04:00',\n",
       "               '2020-11-30 00:00:00-05:00', '2020-12-31 00:00:00-05:00'],\n",
       "              dtype='datetime64[ns, US/Eastern]', freq='M')"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dti = pd.date_range('2020/01/01', freq='M', periods=12, tz='US/Eastern')\n",
    "dti"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2020-01-31 05:00:00+00:00', '2020-02-29 05:00:00+00:00',\n",
       "               '2020-03-31 04:00:00+00:00', '2020-04-30 04:00:00+00:00',\n",
       "               '2020-05-31 04:00:00+00:00', '2020-06-30 04:00:00+00:00',\n",
       "               '2020-07-31 04:00:00+00:00', '2020-08-31 04:00:00+00:00',\n",
       "               '2020-09-30 04:00:00+00:00', '2020-10-31 04:00:00+00:00',\n",
       "               '2020-11-30 05:00:00+00:00', '2020-12-31 05:00:00+00:00'],\n",
       "              dtype='datetime64[ns, GMT]', freq='M')"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dti.tz_convert('GMT')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"http://hilpisch.com/tpq_logo.png\" alt=\"The Python Quants\" width=\"35%\" align=\"right\" border=\"0\"><br>\n",
    "\n",
    "<a href=\"http://tpq.io\" target=\"_blank\">http://tpq.io</a> | <a href=\"http://twitter.com/dyjh\" target=\"_blank\">@dyjh</a> | <a href=\"mailto:training@tpq.io\">training@tpq.io</a>"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
